package com.aneliya.command.application;

import com.aneliya.framework.mvc.Facade;
import com.aneliya.framework.mvc.controller.ICommand;
import com.aneliya.framework.mvc.controller.MVCEvent;
import com.aneliya.mediator.ChatWindowMediator;
import com.aneliya.mediator.LoginDialogMediator;
import com.aneliya.proxy.ServerProxy;

public class StartApplicationCommand implements ICommand {

	public void execute(MVCEvent event) {
		try {
			ServerProxy serverProxy = 
				(ServerProxy) Facade.getInstance().retrieveProxy("ServerProxy");
			serverProxy.start();
			
			ChatWindowMediator chatWindowMediator = 
				(ChatWindowMediator) Facade.getInstance().retrieveMediator("ChatWindowMediator");
			LoginDialogMediator loginDialogMediator = 
				(LoginDialogMediator) Facade.getInstance().retrieveMediator("LoginDialogMediator");
			
			chatWindowMediator.open();
			loginDialogMediator.open();
		} catch (Exception ex) {
			ex.printStackTrace();
		}

	}

}
